package com.yzc.mihuyou.mapper;

import com.yzc.mihuyou.entity.Comment;
import com.yzc.mihuyou.entity.Pingive;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yzc
 * @since 2022-05-04
 */
@Mapper
public interface PingiveMapper extends BaseMapper<Pingive> {
    @Select("SELECT c.comment_id,blog_id,c.content,P.gmt_create AS p_creat,P.user_id AS user_ids FROM `comment` as c\n" +
            "JOIN pingive AS P ON P.pinzan = c.comment_id\n" +
            "JOIN user as u ON u.user_id=c.user_id\n" +
            "WHERE c.user_id = ${Uid}")
    public List<Comment> likeInform(@Param("Uid") Integer Uid);
}
